#!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
@Project ：turbo 
@File    ：filters.py
@Author  ：赵加响
@Date    ：2023/5/26 11:48 
@Desc    ：
"""
import django_filters

from apps.codetable.models import CodeTableDetail


class CodeTableFilter(django_filters.rest_framework.FilterSet):
    model = django_filters.CharFilter(field_name='codetable_head__model', lookup_expr='exact')
    field = django_filters.CharFilter(field_name='codetable_head__field', lookup_expr='exact')

    class Meta:
        model = CodeTableDetail
        fields = ['model', 'field']
